package com.crawler.gmail.enums;

/**
 * <描述>
 * <详细介绍>
 *
 * @author 王明明
 * @since wiki
 */
public enum FileTypeEnum {

    DOC(0, "doc"),
    PDF(1, "pdf"),
    HTML(2, "html"),
    MAIL(3, "email"),
    OTHER(4, "other"),
    JPEG(5, "jpg"),
    RTF(6, "rtf"),
    SQLITE(7, "sqlite"),
    PPT(8, "ppt"),
    PPTX(9, "pptx"),
    ZIP(10, "zip"),
    DOCX(11, "docx");

    public static FileTypeEnum findSuffix(String suffix) {
        switch (suffix) {
            case "doc":
                return DOC;
            case "docx":
                return DOCX;
            case "pdf":
                return PDF;
            case "htm":
                return HTML;
            case "html":
                return HTML;
            case "jpg":
                return JPEG;
            case "jpeg":
                return JPEG;
            case "png":
                return JPEG;
            case "sqlite":
                return JPEG;
            case "ppt":
                return PPT;
            case "pptx":
                return PPTX;
            case "zip":
                return ZIP;
            default:
                return OTHER;
        }
    }

    FileTypeEnum(Integer value, String suffix) {
        this.value = value;
        this.suffix = suffix;
    }

    private Integer value;
    private String suffix;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }
}

